-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Support for Customising the Shell for Pre and Post Workflow Hooks #3451
Conversation
Thank you for the contribution but can we also add this for run steps, not just for pre and post hooks? |
I'm sure that is possible, but is outside the scope of this issue/feature request, so not within this PR. |
To me, it doesn't make sense to do it in one section and not in another. It's confusing and some people will reach out and ask why it's implemented in workflow hooks which is a recent feature but not in "steps" which is the one of the oldest features. Please reconsider. |
I hate scope creep in PRs. The code is completely separate for the two features, so it can be done in a different PR. |
I will prefer in different PRs, pre and post workflow hooks are very specific steps compared with run and some people do not use pre/post workflows but I will say 99% people use the |
I appreciate your work and am thankful for this contribution. I'm just concerned that this pr may merge and a follow up for overriding the shell for run steps isn't contributed leaving the project with a half finished feature. I'm ok with 2 PRs as well. |
One thing I'd like to call out too. It's odd that this logic is in multiple places which then requires separate prs. We'd want the pre/post/regular run steps to all use the same logic so if the logic was updated, it would impact all 3. It would seem that all 3 are currently using a copy and pasted interface instead of using a shared interface. It would be a great contribution if the follow up PR could help refactor and make the code more DRY. But i know i may be asking for too much here. Thank you again for your effort. |
@nitrocode, can you re-review this PR? |
Hi @X-Guardian , i appreciate all your work but my original comment hasn't been addressed. I'd prefer to merge a pr to change the interpretter for the individual run steps prior to merging this pr for pre and post workflow hooks. |
OK @nitrocode. I have to say I am disappointed with your response to this. Just so you know, I won't be implementing this request as I have no need for it, and the original scope of the issue and PR was always only for the pre/post workflows. |
I'm also disappointed as I think if and when this pr is merged, the implementation will be half baked because it will be implemented on workflow hooks but not run steps. I also understand that you do not want to finish that implementation. Please remember that this is volunteer based on both contributors and reviewers. cc @jamengual has volunteered to take over this. Thanks for being patient @X-Guardian |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@GenPage any thoughs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can resolve this easily without disappointments. It would be an easy quick win to add this feature to the run_step_runner based on the changes I see here.
However, it does not seem prudent to gate this PR on the basis of requiring the contributor to perform a refactor or expanding PR scope if they've already refused. This project is very much heavily driven by contributors in terms of adding features and code changes.
Given the situation, if someone wants this added to the run step, they will have a solid template for that work in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@GenPage, @jamengual this PR needs another review as I needed to resolve some conflicts. |
@X-Guardian Looks like the other PR conflicts the tests with this one. |
Head branch was pushed to by a user without write access
what
Update the pre and post workflow hooks with additional
shell
andshellArgs
properties to allow customisation of the shellused to run the hooks.
Grammar fixes have also been actioned on the contents of the
runatlantis.io/docs/pre-workflow-hooks.md
file.why
bash
for custom workflow'srun
step? #2177tests
Default Shell
Pre Workflow Output
Post Workflow Output
Custom Shell
repos.yaml
Pre Workflow Output
Post Workflow Output
Custom ShellArgs
repos.yaml
Pre Workflow Output
Post Workflow Output
Custom Shell and ShellArgs
repos.yaml
Pre Workflow Output
Post Workflow Output